package com.margo.project.netty.zk;

import com.google.gson.Gson;
import com.margo.project.netty.zk.bean.create.MargoZKCreateResponse;
import com.margo.project.netty.zk.utils.MargoCreateMode;

import org.junit.Test;


import java.util.List;

public class ZkClientTest {
    @Test
    public void testZkClient() throws Exception {
        // NettyZkClient的构造方法里面会调用login() 跟服务端建立会话
    	MargoZKClient nettyZkClient = new MargoZKClient(30000);

        // 创建一个临时顺序节点
        MargoZKCreateResponse createResponse = nettyZkClient.create("/as", 12312, MargoCreateMode.EPHEMERAL_SEQUENTIAL);
        System.out.println(new Gson().toJson(createResponse));

    }
}
